<?php $__env->startSection('content'); ?>

    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">在线套餐订单管理</strong> /
                    <small>List</small>
                </div>
            </div>
            <?php echo $__env->make('admin._flash', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <hr>

            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-6">
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-s">
                            <button type="button" class="am-btn am-btn-default delete_all"><span
                                        class="am-icon-trash-o"></span> 删除
                            </button>

                        </div>
                    </div>
                </div>
            </div>
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-12">
                    <form class="am-form-inline" method="get">
                        <div class="am-form-group">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" class="am-form-field" name="order_no"
                                       value="<?php echo e(Request::input('order_no')); ?>" placeholder="订单号搜索">
                            </div>


                            <select data-am-selected="{btnSize: 'sm', maxHeight: 360}"
                                    name="statu">
                                <option value="-1" <?php if(Request::input('statu') == '-1'): ?> selected <?php endif; ?>>是否消费
                                </option>
                                <option value="1" <?php if(Request::input('statu') == '1'): ?> selected <?php endif; ?>>已消费</option>
                                <option value="0" <?php if(Request::input('statu') == '0'): ?> selected <?php endif; ?>>未消费</option>
                            </select>
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" id="date_start" value="<?php echo e(Request::input('created_at')); ?>"
                                       class="am-form-field am-input-sm" name="created_at" placeholder="预约时间搜索">
                            </div>

                        </div>

                        <div class="am-form-group" style="margin-top: 3px">
                            <button type="submit" class="am-btn am-btn-default am-btn-sm">查询</button>
                            <a href="/admin/order/onpackorder" class="am-btn am-btn-default am-btn-sm">重置</a>
                        </div>
                    </form>
                </div>

            </div>
            <hr>


            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr style="font-size: 1.6rem">
                                <th><input class="check_all" type="checkbox"></th>
                                <th class="table-id">ID</th>
                                <th class="table-thumb">订单号</th>
                                <th class="table-type">项目</th>
                                <th class="table-type">项目金额</th>
                                <th class="table-type">下单时间</th>
                                <th class="table-type">是否消费</th>
                                <th class="table-set">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k=> $o): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr data-id="<?php echo e($o->id); ?>" style="font-size: 1.6rem">
                                    <th><input class="checked_id" name="checked_id[]" value="" type="checkbox"></th>
                                    <td><?php echo e($k+1); ?></td>

                                    <td>
                                        <?php echo e($o->order_no); ?>

                                    </td>

                                    <td>
                                        <label class=" am-btn-default am-btn am-btn-xs am-radius">
                                            <?php echo e($o->pack->name); ?> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <?php echo e($o->pack->item->name); ?>

                                        </label>

                                    </td>

                                    <td>
                                        <label class=" am-btn-secondary am-btn am-btn-xs am-radius">
                                            <?php echo e($o->price); ?>元
                                        </label>
                                    </td>

                                    <td>
                                        <?php echo e($o->created_at); ?>

                                    </td>
                                    <?php if($o->statu==1): ?>
                                        <td>
                                            <label class=" am-btn-success am-btn am-btn-xs am-radius">
                                                是
                                            </label>
                                            <span id="change_attr" class=" am-btn-default am-btn am-btn-s am-radius change_attr">
                                                点击使用
                                            </span>
                                        </td>
                                    <?php endif; ?>
                                    <?php if($o->statu==0): ?>
                                        <td>
                                            <label class=" am-btn-danger am-btn am-btn-xs am-radius">
                                                否
                                            </label>
                                            <span id="change_attr" class=" am-btn-default am-btn am-btn-s am-radius change_attr">
                                                点击使用
                                            </span>
                                        </td>
                                    <?php endif; ?>


                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a href="/"
                                                   class="am-btn am-btn-primary am-btn-xs"><span
                                                            class="am-icon-pencil-square-o"></span> 编辑
                                                </a>
                                                <a href="/"
                                                   data-method="delete"
                                                   data-token="<?php echo e(csrf_token()); ?>" data-confirm="确认删除吗?"
                                                   class="am-btn am-btn-danger am-btn-xs del_one">
                                                    <span class="am-icon-trash-o"></span> 删除
                                                </a>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


                            </tbody>
                        </table>
                        

                        <div class="am-cf">
                            <div class="am-fr">
                                
                            </div>
                        </div>
                        <hr/>
                        <p>注：.....</p>
                    </form>
                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>


<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
    <script src="/vendor/daterangepicker/moment.js"></script>
    <script src="/vendor/moment/locale/zh-cn.js"></script>
    <script src="/vendor/daterangepicker/daterangepicker.js"></script>

    <script>
        $(function () {
            //改变属性
            $('.change_attr').click(function () {
                var id = $(this).parents('tr').data('id');
                var _this = $(this);
                $.ajax({
                    type: 'PATCH',
                    url: '/admin/onpackorder/change_attr',
                    data: {id: id},
                    success: function () {
                        location.href = location.href;
                    }
                })
            })


            //时间插件
            $('#date_start').daterangepicker({

                "autoUpdateInput": false,
                "autoApply": true,
                "locale": {
                    "format": "YYYY-MM-DD",
                    "applyLabel": "确定",
                    "cancelLabel": "取消"
                }
            }, function (start, end, label) {
                this.element[0].value = start.format('YYYY-MM-DD') + ' ~ ' + end.format('YYYY-MM-DD');
            });
        });

    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.admin.application', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>